{{template "base/base.html" .}}
{{define "head"}}<title>{{i18n .Lang "Search"}} | Go Walker: {{i18n .Lang "Go API documentation and source code view"}}</title>{{end}}
{{define "body"}}
<div>
	{{template "base/alert.html" .}}
    <div>
        <h1>{{i18n .Lang "Search"}}</h1>
        <form class="form-inline" action="/search">
            <div class="form-group col-md-6">
                <input autocomplete="off" class="typeahead form-control" type="text" placeholder="{{i18n .Lang "Type keywords to search"}}" name="q" value="{{.Keyword}}" style="position: relative; display: inline-block; direction: ltr;">
            </div>
            <button class="btn btn-success btn-lg btn-search" type="submit"><i class="icon-search"></i> {{i18n .Lang "Let's go!"}}</button>
        </form>
        <br>
        
        {{if .IsFindPro}}
        <h5>{{i18n .Lang ".%d project(s) found." .ResultCount}}</h5>
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>{{i18n .Lang "Import Path"}}</th>
                    <th>
                        {{i18n .Lang "Synopsis"}} 
                        <small class="text-info">{{i18n .Lang "Hover link to see more"}}.</small>
                    </th>
                    <th>{{i18n .Lang "Rank"}}</th>
                </tr>
            </thead>
            
            {{$newLine := str2html "\n"}}
            {{$lang := .Lang}}
            <tbody>
            {{range .Results}}
            <tr>
                <td><a title="{{i18n $lang "Refs"}}: {{.RefNum}}  {{i18n $lang "Views"}}: {{.Views}}{{$newLine}}{{i18n $lang "Issues"}}: {{.Issues}}  {{i18n $lang "Stars"}}: {{.Stars}}  {{i18n $lang "Forks"}}: {{.Forks}}" href="/{{.ImportPath}}">{{.ImportPath}}</a></td>
                <td>{{.Synopsis}}</td>
                <td><span class="label label-info">{{.Rank}}</span></td>
            </tr>
            {{end}}
            </tbody>
        </table>
        {{else}}
        <p>{{i18n .Lang ".Cannot find project with keyword <b>%s</b>." .Keyword | str2html}}</p>
        {{end}}
    </div>
</div>
{{end}}